<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>兼职乐-快乐生活，快乐工作，尽在兼职乐</title>
<link type="text/css" rel="stylesheet" href="__MYINDEXCSS__common.css" />
<link type="text/css" rel="stylesheet" href="__MYINDEXCSS__home.css" />
<link type="text/css" rel="stylesheet" href="/static/index/font/iconfont.css" />
 <script src="__MYINDEXJS__jquery.js"></script>
    <style>
        p{text-align: center;margin-top:10px;}
        input{height:40px;width:300px;}
        #code1{float:left;height:40px;width: 120px;}
        #img{float:left;height:40px;width: 120px;}
    </style>
</head>

<body>



<!-- logo -->
<div class="nav2">
	<div class="wrap center">
        <a href="{:url('index/login/index')}"><img src="__MYINDEXPIC__/logo2.jpg"></a>
    </div>
</div>

<div id="box" style='width:400px;height:330px;background:#eee;margin:50px auto'>
	<div id='box_top' style='height:60px;width:400px;background:#5DCDBF;text-align:center;line-height:60px;font-size:22px;color:#fff'>				重置密码
	</div>
	
	<div>
		<form action="" method='post'>
			<p><input type="text" name='tel' require='' id='tel' placeholder='&nbsp;&nbsp;电话'></p>
			<p><input type="password" name='pwd' require='' id='pwd' placeholder='&nbsp;&nbsp;密码'></p>
			<p><input type="password" name='repwd' require='' id='repwd' placeholder='&nbsp;&nbsp;重复密码'></p>     	
			<p><input type="button" value='修改' style='height:50px;background:#5DCDBF;font-size:30px;color:#fff' id='resetpwd'></p>	
		</form>
	</div>
</div>

<script>
	$(function(){
		$('#resetpwd').click(function(){
			var pwd = $('#pwd').val();
			var repwd = $('#repwd').val();
			var tel = $('#tel').val();
			if(tel == ""){
				alert('电话不能为空');
				return false;
			}
			if(pwd == ""){
				alert('密码不能为空');
				return false;
			}
			if(repwd == ""){
				alert('重复密码不能为空');
				return false;
			}
			if(pwd!=repwd){
				alert('两次密码不一致');
				return false;
			}
			if(pwd.length<6||pwd.length>12){
				alert('密码6-12位');
				return false;
			}
			$.ajax({
				url: '/index/login/repwd',
				timeout: 5000,
				type: "post",
				data:{"pwd":pwd,"tel":tel},
				dataType: "json",
				error:function(){
					alert('服务器维修.请稍后...');
				},
				success:function(data){
					if(data.code==0){
						alert(data.msg);
					}else{
						window.location.href = '/index/login/index';
					}
				}
			});
		});
	});
</script>
</body>
</html>

